<include file="Public:header" />
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/PCASClass.js" type="text/javascript"></script>
<!-- nice-scroll -->
<script src="__PUBLIC__/style/js/plugins/nice-scroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<script type="text/javascript" src="__PUBLIC__/style/js/TableFreeze.js"></script>
<script src="__PUBLIC__/js/mxcrm_more.js" type="text/javascript"></script>
<style>
body{
	overflow-y: hidden;
}
.option{padding-left:-30px;}
#oDivL_tab_Test3{background-color: #fff;}
.table{max-width: none;}
</style>
<script>
$(function(){
	var scroll_width = 10;
	// var oTableLH_tab_Test3 = 38;
	$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-parseInt($("#table_container").css("padding-bottom").replace("px",""))-10);
	$(window).resize(function(){
		$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-parseInt($("#table_container").css("padding-bottom").replace("px",""))-10);
		$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width-1).width($("#oTableLH_tab_Test3").width());
		$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width);
	})
	$(".nicescroll").niceScroll({
		cursorcolor: "#999",//#CC0071 光标颜色 
	    cursoropacitymax: 0.4, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0 
	    touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备 
	    cursorwidth: scroll_width+"px", //像素光标的宽度 
	    cursorborder: "0", //     游标边框css定义 
	    cursorborderradius: "3px",//以像素为光标边界半径 
	    autohidemode: false, //是否隐藏滚动条 
	    zindex:100,
	    background:"#F3F3F5",//滚动条背景色
	});
	$("#tab_Test3").FrozenTable(1,0,3);
	$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width-1).width($("#oTableLH_tab_Test3").width()).css({'zIndex':9});
	$("#oDivL_tab_Test3").css({"background-color":"#fff","border-right":"1px solid #e7eaec"});
	$("#oTableLH_tab_Test3").css({"border-right":"1px solid #e7eaec"});
	$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width).css({'zIndex':9});
})
</script>
<div class="wrapper wrapper-content">
<include file="Public:alert" />
	<div class="row">
		<div class="col-md-12">
			<div class="ibox float-e-margins">
				<div class="title-bar" style="position: relative;z-index: 99;">
					<div class="row  clearfix" id="title-hide" style="display:none;">
						<ul class="breadcrum pull-left">
							<li>已选中&nbsp;<span id="icheck_num"></span>&nbsp;项</li>
							<if condition="$by neq 'public' and $by neq 'deleted' and $by neq 'transformed'">
								<li class="single_btn"><a href="javascript:void(0)" id="log_leads"><i class="fa fa-file-text"></i>&nbsp;添加沟通日志</a></li>
								<li class="single_btn"><a href="javascript:void(0)" id="remind"><i class="fa fa-bell-o"></i>&nbsp;提醒</a></li>
								<li class="single_btn"><a id="change_lead" href="javascript:void(0)"><i class="icon-repeat i_icon"></i>&nbsp;转化</a></li>
							</if>
							<if condition="$by eq 'public'">
								<li><a id="batch_receive" href="javascript:void(0)">{:L('BATCH_RECEIVE')}</a></li>
								<li><a id="batch_assign" href="javascript:void(0)">{:L('BATCH_ASSIGN')}</a></li>
							<elseif condition="$by neq 'deleted' and $by neq 'transformed'" />
								<li><a id="remove" href="javascript:void(0)"><i class="fa fa-users"></i>&nbsp;{:L('BATCH_LEADS_INTO_THE_POOL')}</a></li>
							</if>
							<if condition="$by neq 'public' and $by neq 'deleted' and $by neq 'transformed'">
								<li class="single_btn"><a href="javascript:void(0)" id="edit_leads"><i class="fa fa-pencil"></i>&nbsp;编辑</a></li>
							</if>
							<li><a href="javascript:void(0);" class="link excelExport"><i class="fa fa-download"></i>&nbsp;导出</a></li>
							<if condition = "($_GET['by'] neq 'public' && checkPerByAction('leads','delete')) || ($_GET['by'] eq 'public' && checkPerByAction('leads','del_public')) || session('?admin')">
								<li><a id="delete" href="javascript:void(0)"><i class="fa fa-times"></i>&nbsp;删除</a></li>
							</if>
							<li class="last_li"><big><a class="fa fa-times pull-right" id="back-show"></a></big></li>
						</ul>
					</div>
					<div class="row " id="title-show">
						<ul class="nav pull-left" style="margin:2px 0 0 15px;">
							<a href="{:U('leads/add')}" class="btn btn-primary btn-sm pull-left" style="margin-right:8px"><i class="fa fa-plus-circle"></i>&nbsp; 新建线索</a>
						</ul>
						<form class="form-inline" id="leads_search" action="" method="get">
							<ul class="breadcrum pull-right" style="margin-bottom: 0px">
								<if condition="$_GET['by'] != 'public'">
									<li>
										<div class="input-group" style="margin-right: 10px;margin-bottom: 5px;">
											<select class="form-control" onchange="window.open(this.options[this.selectedIndex].value,target='_self')" >
												<option value="{:U('leads/index','by=me&'.$by_parameter)}" <if condition = "$_GET['by'] eq 'me' || $_GET['by'] eq ''">selected="selected"</if>>我的线索</option>
												<option value="{:U('leads/index','by=sub&'.$by_parameter)}" <if condition = "$_GET['by'] eq 'sub'">selected="selected"</if>>下属线索</option>
												<option value="{:U('leads/index','by=all&'.$by_parameter)}" <if condition = "$_GET['by'] eq 'all'">selected="selected"</if>>全部线索</option>
												<option value="{:U('leads/index','by=transformed&'.$by_parameter)}" <if condition = "$_GET['by'] eq 'transformed'">selected="selected"</if>>已转换线索</option>
											</select>
										</div>
									</li>
								</if>
								<li>
									搜索：
									<div class="input-group">
										<input type="hidden" name="m" value="leads"/>
										<input type="hidden" name="a" value="index"/>
										<input type="hidden" name="field" value="name"/>
										<input type="hidden" name="condition" value="contains"/>
										<input type="hidden" name="by" value="{$_GET['by']}"/>
										
										<if condition = "$_GET['field']">
											<!-- 导出相关 -->
											<input type="hidden" name="this_page" value="{$this_page}" />
											<input type="hidden" name="act" id="act" value="index"/>
											<input type="hidden" name="daochu" id="daochu"/>
											<input type="hidden" name="selectexcelxport" id="selectexcelxport"/>
											<input type="hidden" name="current_page" id="current_page" value=""/>
											<input type="hidden" name="export_limit" id="export_limit" value=""/>
											<!-- 导出相关 -->
										</if>

										<input id="short_search" type="text" style="width:160px;" placeholder="请输入线索名称" onkeydown='if(event.keyCode==13) {$("#short_search_btn").trigger("click");return false;}' class="form-control input-sm" name="search" <if condition = "$_GET['field'] eq 'name'">value="{$_GET['search']}"</if>/>
										<span class="input-group-btn">
											<button class="btn btn-default btn-search" id="short_search_btn" type="submit"><i class="fa fa-search"></i></button>
										</span>
									</div>
									&nbsp;&nbsp;<a title="高级搜索" href="javascript:void(0)" id="search_type" class="btn btn-white btn-bitbucket"><i class="fa fa-filter" style="color: #D8E3EF;"></i></a>
								</li>
								<div class="btn-group ">
	                                <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" aria-expanded="false">操作 <span class="caret"></span>
	                                </button>
	                                <ul class="dropdown-menu">
	                                    <if condition = "checkPerByAction('customer','excelimport')">
											<li><a id="import_excel" class="link" href="javascript:void(0);"><i class="fa fa-upload"></i>&nbsp;导入</a></li>
										</if>
										<if condition = "checkPerByAction('customer','excelexport')">
											<li><a href="javascript:void(0);" class="link excelExport"><i class="fa fa-download"></i>&nbsp;导出</a></li>
										</if>
	                                </ul>
	                            </div>
							</ul>
						</form>
					</div>
				</div>
				<div class="ibox-content clearfix" id="table_container" style="z-index: 1;">
					<form id="form1" action="" method="post" style="position:relative;">
						<input type="hidden" name="owner_id" id="hidden_owner_id" value="0"/>
						<input type="hidden" name="message" id="hidden_message" value="0"/>
						<input type="hidden" name="sms" id="hidden_sms" value="0"/>
						<input type="hidden" name="email" id="hidden_email" value="0"/>
						<div id="table_div" class="nicescroll">
							<table class="table table-hover table-striped table_thead_fixed" id="tab_Test3">
								<empty name="leadslist">
									<div style="background-color:#fff;"><include file="Public:nodata" /></div>
								<else/>					
									<tr id="childNodes_num" class="tabTh">
										<td style="width:30px;padding-left: 20px">
											<div class="checkbox checkbox-primary">
												<input type="checkbox" class="check_all"/>
												<label for=""></label>
											</div>
										</td>
										<if condition="$by neq 'public' and $by neq 'deleted'">
											<td style="max-width: 6px;">&nbsp;</td>
										</if>
										<volist name="field_array" id="vo">
											<td>{$vo.name}</td>
										</volist>
										<if condition="$by neq 'public'">
											<td>{:L('OWNER_ROLE')}</td>
										</if>
										<td>{:L('CREATOR_ROLE')}</td>
										<td style="width:130px">
											<if condition="$_GET['desc_order'] == 'create_time'">
												<a href="{:U('leads/index','asc_order=create_time&'.$parameter)}" title="点击按时间正序排列">
													{:L('CREATE_TIME')}&nbsp;<span class="fa fa-caret-down"></span>
												</a>
											<elseif condition="$_GET['asc_order'] == 'create_time'"/>
												<a href="{:U('leads/index','desc_order=create_time&'.$parameter)}"  title="点击按时间倒序排列">
													{:L('CREATE_TIME')}&nbsp;<span class="fa fa-caret-up"></span>
												</a>
											<else/>
												<a href="{:U('leads/index','asc_order=create_time&'.$parameter)}" title="点击按时间正序排列">{:L('CREATE_TIME')}&nbsp;<span class="fa fa-caret-down"></a>
											</if>
										</td>
										<if condition="$_GET['asc_order'] == 'have_time' and ($by neq 'public' && $by neq 'deleted')">
											<td >
												<a href="{:U('leads/index','desc_order=have_time&'.$parameter)}">
													{:L('DEADLINE')}&nbsp;<img src="__PUBLIC__/img/arrow_up.png">
												</a>
											</td>
										<elseif condition="$_GET['desc_order'] == 'have_time' and ($by neq 'public' && $by neq 'deleted')"/>
											<td >
												<a href="{:U('leads/index','asc_order=have_time&'.$parameter)}">
													{:L('DEADLINE')}&nbsp;<img src="__PUBLIC__/img/arrow_down.png">
												</a>
											</td>
										<elseif condition="$by neq 'public' && $by neq 'deleted' && $by neq 'transformed'"/>
											<td >
												<a href="{:U('leads/index','desc_order=have_time&'.$parameter)}">{:L('DEADLINE')}</a>
											</td>
										</if>
										<if condition="$by eq 'transformed'">
											<td>{:L('CONVERT_TO_CUSTOMER')}</td>
											<td>{:L('CONVERT_TO_CONTACTS')}</td>
										<else/>
											<td></td>
										</if>
									</tr>
									<volist name="leadslist" id="vo">
										<tr class="controls_tr">
											<td style="width: 30px;padding-left: 20px">
												<div class="checkbox checkbox-primary">
													<input name="leads_id[]" class="check_list" type="checkbox" value="{$vo.leads_id}" />
													<label for=""></label>
												</div>
											</td>
											<if condition="$by neq 'public' and $by neq 'deleted'">
												<td>
													<a href="javascript:void(0);" class="remind_view" rel="{$vo['leads_id']}">
														<span class="fa fa-bell-o {$vo['remind_time'] > time() ? '':'hide'}" style="font-size:16px;color:orange"></span>
													</a>
												</td>
											</if>
											<volist name="field_array" id="v">
												<td <if condition = "$v['field'] eq 'nextstep_time'">id="nextstep_time_{$vo['leads_id']}"<elseif condition = "$v['field'] eq 'nextstep'"/>id="nextstep_{$vo['leads_id']}"<else /></if>>
													<if condition="$v['field'] eq 'name'">
														<?php if(C('CALL_CENTER') == 1): ?>
															<a href="javascript:void(0);" class="call" title="点击呼叫" phone="{$vo.mobile}" rel="{$vo['leads_id']}" model="leads" style="font-size: 18px;">
																<i class="fa fa-phone"></i>
															</a>&nbsp;&nbsp;
														<?php endif; ?>
														<a href="{:U('leads/view', 'id='.$vo['leads_id'])}" target="_blank" title="{:L('VIEW')}">{$vo[$v['field']]}</a>
													<elseif condition="$v['field'] eq 'nextstep_time' and $vo[$v['field']] lt (strtotime(date('Y-m-d'))+86400)  and $vo[$v['field']] gt 0 and  $vo[$v['field']] gt (strtotime(date('Y-m-d')))"/>
														<span style="color:green;cursor:pointer;" class="show-txt">{$vo[$v['field']]|date='Y-m-d H:i',###}
															<notempty name="vo['nextstep']">
																<div class="show-txtsub">
																	<span style="color:blue;">下次联系内容: </span>{$vo['nextstep']}
																</div>
															</notempty>
														</span>
													<elseif condition="$v['field'] eq 'nextstep_time' and $vo[$v['field']] lt strtotime(date('Y-m-d')) and $vo[$v['field']] gt 0" />
														<span style="color:red;cursor:pointer;" class="show-txt">{$vo[$v['field']]|date='Y-m-d H:i',###}
															<notempty name="vo['nextstep']">
																<div class="show-txtsub">
																	<span style="color:blue;">下次联系内容: </span>{$vo['nextstep']}
																</div>
															</notempty>
														</span>
													<elseif condition="$v['form_type'] eq 'datetime' and $vo[$v['field']] gt 0" />
														<span style="color:#{$v['color']};cursor:pointer;" class="show-txt">{$vo[$v['field']]|date='Y-m-d H:i',###}
															<notempty name="vo['nextstep']">
																<div class="show-txtsub">
																	<span style="color:blue;">下次联系内容: </span>{$vo['nextstep']}
																</div>
															</notempty>
														</span>
													<else />
														<span style="color:#{$v['color']}">
															<notempty name="vo[$v['field']]">{$vo[$v['field']]}</notempty>
														</span>
													</if>
												</td>
											</volist>
											<if condition="$by neq 'public'">
												<td>
													<a class="role_info" rel="{$vo.owner.role_id}" href="javascript:void(0)">{$vo.owner.user_name}</a>
												</td>
											</if>
											<td>
												<a class="role_info" rel="{$vo['creator']['role_id']}" href="javascript:void(0)">{$vo.creator.user_name}</a>
											</td>
											<td >{$vo['create_time'] ? $vo['create_time']|date='Y-m-d H:i',### : ''}</td>
											<if condition="$by neq 'public' && $by neq 'deleted' && $by neq 'transformed'">
												<td>
													<if condition="$vo['days'] gt 7 ">
														<font color="#08c">{$vo.days}{:L('DAYS')}</font>
													<elseif condition="$vo['days'] elt 7 and $vo['days'] gt 0" />
														<font color="red">{$vo.days}{:L('DAYS')}</font>
													<elseif condition="isset($vo['days'])"/>
														<font color="red">{$vo.days}{:L('DAYS')}</font>
													<else/>
														{$vo.days}
													</if>
												</td>
											</if>
											<if condition="$by eq 'transformed'">
												<td><a target="_blank" href="{:U('customer/view','id='.$vo['customer_id'])}">{$vo['customer_name']}</a></td>
												<td><a target="_blank" href="{:U('contacts/view','id='.$vo['contacts_id'])}">{$vo['contacts_name']}</a></td>
											</if>
										</tr>
									</volist>
								</empty>	
							</table>
						</div>
						<div id="tfoot_div" class="clearfix">
							<div class="clearfix" id="tfoot_page">
								<if condition="$fields_search || $_GET['field']">
									<span class="pull-left" style="margin-left:25px;margin-top:10px;">本次搜索结果<span style="color:#F8AC59"> {$count} </span>条数据<a href="{:U('leads/index')}" class="btn" style="background:#fff;border:1px solid #ccc;margin-left:10px;color:#999;" id="clearnumber">清除搜索条件</a></span>
								</if>
								{$page}<include file="Public:listrows" />
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>

<div style="display:none;" id="dialog-import" title="{:L('IMPORT_DATA')}">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none;" id="dialog-role-info" title="{:L('USER_INFO')}">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none;" id="dialog-fenpei" title="{:L('LEADS_ASSIGN')}">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none;" id="dialog-assign" title="{:L('LEADS_ASSIGN')}">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none" id="dialog-log" title="添加沟通日志">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none" id="dialog-remind" title="提醒">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none" id="dialog-remind_view" title="提醒内容">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<if condition = "$_GET['by'] neq 'public'">
	<div id="dialog-role-list2" style="display:none" title="选择客户负责人">
		<div class="spiner-example">
			<div class="sk-spinner sk-spinner-three-bounce">
				<div class="sk-bounce1"></div>
				<div class="sk-bounce2"></div>
				<div class="sk-bounce3"></div>
			</div>
		</div>
	</div>
</if>
<div style="display:none" id="dialog-field-search" title="高级搜索">
	<form class="form-inline" id="searchForm" action="" method="get">
		<div id="search_add" style="width:650px;float:left;">
			<if condition = "$_GET['field'] eq ''">
				<input type="hidden" name="this_page" value="{$this_page}" />
				<input type="hidden" name="m" value="leads"/>
				<input type="hidden" name="act" id="act" value="index"/>
				<input type="hidden" name="daochu" id="daochu"/>
				<input type="hidden" name="current_page" id="current_page" value=""/>
				<input type="hidden" name="export_limit" id="export_limit" value=""/>
				<if condition="$by neq null">
					<input type="hidden" name="by" value="{$by}"/>
				</if>
			</if>
			<empty name="fields_search">
				<div id="con_search_1" style="float:left;width:650px;margin:0 10px 0 10px;">
					<ul class="nav pull-left" style="margin:0px 0 0 23px;width:650px;">
						<li class="pull-left">
							<select id="field_1" style="width:auto" class="form-control input-sm field_name new-select" onchange="changeCondition(1)" >
								<option class="" value="name">--{:L('PLEASE_SELECT_A_FILTER_CONDITION')}--</option>
								<volist name="field_list" id="v">
									<option class="{$v['form_type']}" value="{$v[field]}" rel="leads" <if condition = "$_GET['field'] eq '' && $v['field'] eq 'name'">selected="selected"</if>>{$v[name]}</option>
								</volist>
								<if condition="$by neq 'public'">
									<option class="role" value="owner_role_id">{:L('PRINCIPAL')}</option>
								</if>
								<option class="date" value="create_time">{:L('CREATION_TIME')}</option>
								<option class="date" value="update_time">{:L('MODIFICATION_TIME')}</option>
							</select>&nbsp;&nbsp;
						</li>
						<li class="pull-left" id="conditionContent_1">
							<select id="condition_1" style="width:auto" class="form-control input-sm new-select" onchange="changeSearch()" name="name[condition]">
								<option value="contains">{:L('INCLUDE')}</option>
								<option value="not_contain">{:L('EXCLUSIVE')}</option>
								<option value="is">{:L('YES')}</option>
								<option value="isnot">{:L('ISNOT')}</option>						
								<option value="start_with">{:L('BEGINNING_CHARACTER')}</option>
								<option value="end_with">{:L('TERMINATION_CHARACTER')}</option>
								<option value="is_empty">{:L('Mandatory')}</option>
								<option value="is_not_empty">{:L('ISNOTEMPTY')}</option>
							</select>&nbsp;&nbsp;
						</li>
						<li class="pull-left" id="searchContent_1">
							<input id="search_1" type="text" style="width:160px;" class="input-medium form-control input-sm search-query" name="name[value]"/>&nbsp;&nbsp;
						</li>
					</ul>
				</div>
				<?php $max_key = 1;?>
			<else />
			<volist name="fields_search" key="key1" id="vo">
				<div id="con_search_{$key1}" style="float:left;width:650px;margin:10px 10px 0 10px;">
					<div  id="rem_{$key1}" class="pull-left" style="line-height:30px;"><a href="javascript:void(0);" class="rem_search" rel="{$key1}" title="移除"><span class="fa fa-times-circle"></span></a></div>&nbsp;
					<ul class="nav pull-left" style="margin:0px 0 0 5px;width:620px;">
						<li class="pull-left">
							<select id="field_{$key1}" style="width:auto" class="form-control input-sm field_name" onchange="changeCondition({$key1})" >
								<option class="" value="name">--{:L('PLEASE_SELECT_A_FILTER_CONDITION')}--</option>
								<volist name="field_list" id="v">
									<option class="{$v['form_type']}" value="{$v['field']}" rel="leads" <if condition = "$vo['field'] eq $v['field']">selected="selected"</if>>{$v[name]}
									</option>
								</volist>
								<if condition="$by neq 'public'">
									<option class="role" value="owner_role_id" <if condition = "$vo['field'] eq 'owner_role_id'">selected="selected"</if>>{:L('PRINCIPAL')}</option>
								</if>
								<option class="date" value="create_time" <if condition = "$vo['field'] eq 'create_time'">selected="selected"</if>>{:L('CREATION_TIME')}</option>
								<option class="date" value="update_time" <if condition = "$vo['field'] eq 'update_time'">selected="selected"</if>>{:L('MODIFICATION_TIME')}</option>
							</select>&nbsp;&nbsp;
						</li>
						<li class="pull-left" id="conditionContent_{$key1}">
							<if condition="$vo.form_type eq 'number'">
								<select id="condition" style="width:100px;" class="form-control input-sm" name="{$vo['field']}[condition]">
									<option value="gt" <if condition="$_GET[$vo['field']][condition] eq 'gt'">selected="selected"</if>>{:L('GT')}</option>
									<option value="lt" <if condition="$_GET[$vo['field']][condition] eq 'lt'">selected="selected"</if>>{:L('LT')}</option>
									<option value="eq" <if condition="$_GET[$vo['field']][condition] eq 'eq'">selected="selected"</if>>{:L('EQ')}</option>
									<option value="neq" <if condition="$_GET[$vo['field']][condition] eq 'neq'">selected="selected"</if>>{:L('NEQ')}</option>
								</select>	
							<elseif condition="$vo.field eq 'owner_role_id' || $vo.form_type eq 'datetime'"/>
							<elseif condition="$vo.form_type eq 'box'" />
								<span id="{$vo['field']}"></span>
								<script type="text/javascript">
									var b = '{$vo[field]}';
									var c = 'leads';
									$.ajax({
										type:'get',
										url:'index.php?m=setting&a=boxfield&model='+c+'&field='+b,
										async:false,
										success:function(data){
											options = '';
											$.each(data.data, function(k, v){
												if('{$vo.value}' == v){
													select = 'selected';
												}else{
													select = '';
												}
												options += "<option value='"+v+"' "+select+">"+v+"</option>";
											});
											$("#{$vo['field']}").html('<select class="{$vo["field"]} form-control input-sm" style="width:auto" name="{$vo["field"]}[value]" ><option value="">--请选择--</option>' + options + '</select>&nbsp;&nbsp;');	
										},
										dataType:'json'
									});	
									<if condition="!empty($_GET[$vo['field']])">
										$(".{$vo['field']} option[value='{$_GET[$vo['field']]}']").attr('selected','selected');
									</if>
								</script>	
							<elseif condition="$vo.form_type eq 'address'" />
								<select style="width:auto;margin-top: 13px;" class="form-control input-sm" name="{$vo['field']}[condition]">
									<option value="contains" <if condition="$_GET[$vo['field']][condition] eq 'contains'">selected="selected"</if>>{:L('IN')}</option>
									<option value="not_contain" <if condition="$_GET[$vo['field']][condition] eq 'not_contains'">selected="selected"</if>>{:L('NOTIN')}</option>
								</select>
								<select name="{$vo['field']}[state]" class="form-control input-sm" id="state" style="width:135px;margin-top: 13px;"></select>
								<select name="{$vo['field']}[city]" class="form-control input-sm" id="city" style="width:110px;margin-top: 13px;"></select>
								<select name="{$vo['field']}[area]" class="form-control input-sm" id="area" style="width:110px;margin-top: 13px;"></select>
								<input type="text" id="search" name="{$vo['field']}[search]" value="{$_GET[$vo['field']][search]}" class="form-control input-sm" style="margin-top: 13px;" placeholder="{:L('THE_STREET_INFORMATION')}" class="input-large">
								<script type="text/javascript">
									 new PCAS("{$vo['field']}[state]","{$vo['field']}[city]","{$vo['field']}[area]","<php>echo $_GET[$vo['field']]['state'];</php>","<php>echo $_GET[$vo['field']]['city'];</php>","<php>echo $_GET[$vo['field']]['area'];</php>");
								</script>
							<else />
								<select id="condition" style="width:auto" class="form-control input-sm" name="{$vo['field']}[condition]">
									<option value="contains" <if condition="$_GET[$vo['field']][condition] eq 'contains'">selected="selected"</if>>{:L('INCLUDE')}</option>
									<option value="not_contain" <if condition="$_GET[$vo['field']][condition] eq 'not_contain'">selected="selected"</if>>{:L('EXCLUSIVE')}</option>
									<option value="is" <if condition="$_GET[$vo['field']][condition] eq 'is'">selected="selected"</if>>{:L('YES')}</option>
									<option value="isnot" <if condition="$_GET[$vo['field']][condition] eq 'isnot'">selected="selected"</if>>{:L('NO')}</option>					
									<option value="start_with" <if condition="$_GET[$vo['field']][condition] eq 'start_with'">selected="selected"</if>>{:L('BEGINNING_CHARACTER')}</option>
									<option value="end_with" <if condition="$_GET[$vo['field']][condition] eq 'end_with'">selected="selected"</if>>{:L('TERMINATION_CHARACTER')}</option>
									<option value="is_empty" <if condition="$_GET[$vo['field']][condition] eq 'is_empty'">selected="selected"</if>>{:L('MANDATORY')}</option>
									<option value="is_not_empty" <if condition="$_GET[$vo['field']][condition] eq 'is_not_empty'">selected="selected"</if>>{:L('ISNOTEMPTY')}</option>
								</select>
							</if>
						</li>
						<li class="pull-left" id="searchContent_{$key1}" style="margin-left:5px;">
							<if condition="$vo.form_type neq 'box' && $vo.form_type neq 'address'">
								<if condition="$vo.form_type eq 'datetime'">
									<input id="start_{$vo['field']}" type="text" class="form-control input-sm search-query" name="{$vo['field']}[start]" onclick="WdatePicker()" value="{$fields_search[$vo['field']][start]}" rel="leads"/> 至 <input id="end_{$vo['field']}" type="text" class="form-control input-sm search-query" name="{$vo['field']}[end]" onclick="WdatePicker()" value="{$fields_search[$vo['field']][end]}" rel="leads"/>
								<elseif condition="$vo['field'] eq 'owner_role_id'"/>
									<span id="owner_role_search" rel="{$key1}" rel1="{$vo['field']}[value]" rel2="{$_GET[$vo['field']][value]}"/>
									<script type="text/javascript">
										var key_id = $('#owner_role_search').attr('rel');
										var search_owner_role_id = $('#owner_role_search').attr('rel1');
										var owner_roleid = $('#owner_role_search').attr('rel2');
										$.ajax({
											type:'get',
											url:'index.php?m=user&a=getrolelist&module=leads&action=index',
											async:false,
											success:function(data){
												options = '';
												$.each(data.data, function(k, v){
													options += '<option value="'+v.role_id+'" checkedit>'+v.user_name+' ['+v.department_name+'-'+v.role_name+'] </option>';
												});
												$("#searchContent_"+key_id+"").html('<select class="selectpicker show-tick form-control input-sm" data-live-search="true" id="search_'+key_id+'" name="'+search_owner_role_id+'" style="width:auto">' + options + '</select>');
												/*$('#search_'+key_id).selectpicker('val',owner_roleid);
												$('#search_'+key_id).selectpicker('refresh');*/
												var owner_roleid = "{$_GET[$vo['field']][value]}";
												$('#search_'+key_id+' option[value='+owner_roleid +']').prop('selected',true);
												
											},
											dataType:'json'
										});		
									</script>
								<else/>	
									<input name="{$vo['field']}[value]" type="text" class="form-control input-sm search-query" class="{$vo['form_type']}" value="{$_GET[$vo['field']][value]}" rel="leads">
								</if>
							</if>
						</li>
					</ul>
				</div>
				<?php $max_key = $key1;?>
			</volist>
			</empty>
		</div>
		<div class="clearfix"></div>
		<div style="margin-left: 35px;margin-top:10px;"><a href="javascript:void(0);" style="display: -moz-stack;margin: 30px 0px 0px; font-size: 12px; color: rgb(62, 133, 233);" id="add_btn">+添加筛选条件</a>
		</div>
	</form>
</div>
<script type="text/javascript">
/*让复选框默认取消选择*/
$(':checkbox').prop('checked', false);
$('[data-toggle="tooltip"]').tooltip({html:true});

$(".controls_tr").mouseenter(function(){
	$(this).find(".controls").show();
}).mouseleave(function(){
	$(this).find(".controls").hide();
});

/*添加筛选条件*/
var m = {$max_key};
$('#add_btn').click(function(){
	m += 1;
	$('#search_add').append('<div id="con_search_'+m+'" style="float:left;width:500px;padding-top:10px;margin:0px 10px 0 10px;"><div  id="rem_'+m+'" class="pull-left" style="line-height:30px;"><a href="javascript:void(0);" class="rem_search" rel="'+m+'" title="移除"><span class="fa fa-times-circle"></span></a></div>&nbsp;<ul class="nav pull-left" style="margin:0px 0 0 5px;width:470px"><li class="pull-left"><select id="field_'+m+'"  style="width:auto" class="form-control input-sm field_name new-select" onchange="changeCondition('+m+')" name=""><option class="" value="name">--{:L('PLEASE_SELECT_A_FILTER_CONDITION')}--</option><volist name="field_list" id="v"><option class="{$v['form_type']}" value="{$v[field]}" rel="leads">{$v[name]}</option></volist><if condition="$by neq 'public'"><option class="role" value="owner_role_id">{:L('PRINCIPAL')}</option></if><option class="date" value="create_time">{:L('CREATION_TIME')}</option><option class="date" value="update_time">{:L('MODIFICATION_TIME')}</option></select>&nbsp;&nbsp;</li><li class="pull-left" id="conditionContent_'+m+'"><select id="condition_'+m+'" style="width:99px" class="form-control input-sm new-select" name="condition" onchange="changeSearch()"><option value="contains">{:L('INCLUDE')}</option><option value="not_contain">{:L('EXCLUSIVE')}</option><option value="is">{:L('YES')}</option><option value="isnot">{:L('ISNOT')}</option><option value="start_with">{:L('BEGINNING_CHARACTER')}</option><option value="end_with">{:L('TERMINATION_CHARACTER')}</option><option value="is_empty">{:L('Mandatory')}</option><option value="is_not_empty">{:L('ISNOTEMPTY')}</option></select>&nbsp;&nbsp;</li><li class="pull-left" id="searchContent_'+m+'"><input id="search_'+m+'" type="text" style="width:160px;" class="input-medium form-control input-sm search-query" name="search"/>&nbsp;&nbsp;</li></ul></div>');  
});
$(document).on('click','.rem_search',function(){
	var num = $(this).attr('rel');
	$('#con_search_'+num).remove();
});

// 筛选重复判断
var dosearch = 1;
function doh(){
	var ary = new Array();
	var field_name = '';
	var is_submit = 1;
	$('.field_name').each(function(k, v){
		field_name = $(this).find("option:selected").val();
		if(jQuery.inArray(field_name,ary) >= 0){
			is_submit = 0;
			swal({
				title: "筛选条件中有重复项！",
				text: "",
				type: "error"
			});
			dosearch = 0;
			return false;
		}
		ary[k] = field_name;
	})
	if(is_submit == 1){
		$("#searchForm").submit();
	}
}

var url = "{:U('leads/getcurrentstatus')}";
var limit_size = 1000;
var count = {$count|default=0};
var ii = 1;
function remainTime(){
	var id_array = new Array();
	// 判断是普通查询还是高级搜索
	var field = "{$_GET['field']}";
	$("input[class='check_list']:checked").each(function() {   
		id_array.push($(this).val());
	});
	$.get(url,function(data){
		if(data.data == 0){
			if (id_array != '') {
				count = id_array.length;
			}
			if((ii-1)*limit_size < count){
				$("#act").val('excel');	
				$("#daochu").val(id_array);
				$("#current_page").val(ii);
				$("#export_limit").val(limit_size);
				if (field) {
					$("#leads_search").submit();
				} else {
					$("#searchForm").submit();
				}	
				setTimeout("remainTime()",1000); 
				ii++; 
			}else{
				$("#act").val('');	
				ii = 1;
				swal("数据导出成功！","","success");
			}
		}else{
			setTimeout("remainTime()",1000); 
		}
	}, 'json');
}

if ("{:C('isMobile')}" == "1") {
	width = $('.container').width() * 0.9;
} else {
	width = 800;
}

$("#log_leads").click(function(){
	$('#dialog-log').dialog('open');
	$('#dialog-log').load('{:U("log/add","r=RLeadsLog&module=leads&id=")}'+$(this).attr('rel'));
});

$("#dialog-log").dialog({
    autoOpen: false,
    modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100],
	buttons: {
		"确定": function () {
			// $('#dialog_form1').submit();
			// $(this).dialog("close");

			var log_content = $('#log_content').val();
			var nextstep_time = $('#nextstep_time').val();
			if(log_content == ""){
				alert_crm("请填写内容！");
				$("#log_content").focus();
				return false;
			}
        	$.ajax({
	            type:'post',
	            url: "{:U('Log/add')}",
	            data:$('#dialog_form1').serialize(),
	            async: false,
	            success: function (data) {
					if (data.status == 1) {
						swal("操作成功！", "沟通日志添加成功！", "success");
						$("#dialog-log").dialog("close");
						$('#nextstep_time_'+dialog_module_value).html(nextstep_time);
						$('#nextstep_'+dialog_module_value).html(log_content);
						// location.reload();
					} else {
						swal({
							title: "操作失败！",
							text:data.info,
							type: "error"
						})
						return false;
					}
	            },
	            dataType: 'json'
	        });
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});

$("#remind").click(function(){
	var leads_id = $(this).attr('rel');
	$('#dialog-remind').dialog('open');
	$('#dialog-remind').load("{:U('remind/add','module=leads&module_id=')}"+leads_id);
});

$(document).on('click','.remind_view',function(){
	var leads_id = $(this).attr('rel');
	$('#dialog-remind_view').dialog('open');
	$('#dialog-remind_view').load("{:U('remind/view','module=leads&module_id=')}"+leads_id);
});

$("#dialog-remind").dialog({
	autoOpen: false,
	modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100],
	buttons: {
		"确定": function () {
			if($('#dialog_content').val() == ''){
				alert_crm("请填写提醒内容！")
				$("#dialog_content").focus(); 
			}else{
				$('#remind_form').submit();
				$(this).dialog("close");
			}
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});
$("#dialog-remind_view").dialog({
	autoOpen: false,
	modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100],
	buttons: {
		"删除": function () {
			swal({
				title: "您确认删除吗？" ,
				type: "warning",   
				showCancelButton: true,   
				confirmButtonColor: "#DD6B55",   
				confirmButtonText: "确定",   
				closeOnConfirm: false 
			}, 
			function(){
				$("#dialog_remind").submit();
				$(this).dialog("close");
			});
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});

$("#edit_leads").click(function(){
	window.location.href="{:U('leads/edit', '&p='.$this_page.'&id=')}"+$(this).attr('rel');
})
var by = "{$_GET['public']}";
if(by != 'public'){
	$('#change_lead').click(
		function(){
			var leads_id = $(this).attr('rel');
			$('#dialog-role-list2').dialog('open');
			$('#dialog-role-list2').load("{:U('user/listDialog','by=all&leads=leads&id=')}"+leads_id);
		}
	);
	$("#dialog-role-list2").dialog({
		autoOpen: false,
		modal: true,
		width: width,
		maxHeight: 400,
		buttons: { 
			"确定": function () {
				var item = $('input:radio[name="owner"]:checked').val();
				var name = $('input:radio[name="owner"]:checked').parent().next().html();
				var leads_id = $("#leads_id").val();
				$.ajax({
					type:'get',
					url:'index.php?m=leads&a=change_customer&id='+leads_id+'&role_id='+item,
					async:false,
					success:function(data){
						if(data.status == 1){
							swal("转换成功！", "您已经成功将该线索转换为客户！", "success");
							history.go(0);
						}else{
							alert_crm('转换失败，请重试！');
							history.go(0);
						}
					},
					dataType:'json'
				});
				$(this).dialog("close"); 
			},
			"取消": function () {
				$(this).dialog("close");
			}
		},
		position: ["center", 100]
	});
}

$("#search_type").click(function(){
	$("#dialog-field-search").dialog('open');
});

$("#dialog-field-search").dialog({
	autoOpen: false,
	modal: true,
	minWidth: 750,
	height: 500,
	position: ["center",100],
	buttons: {
		"确定": function () {
			doh();
			if(dosearch == 1){
				$(this).dialog("close");
			}
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});

$("#dialog-import").dialog({
	autoOpen: false,
	modal: true,
	width: 680,
	maxHeight: 400,
	position: ["center",100]
});
$("#dialog-role-info").dialog({
	autoOpen: false,
	modal: true,
	width: width,
	minHeight: 400,
	position: ["center",100]
});
$("#dialog-fenpei").dialog({
	autoOpen: false,
	modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100],
	buttons: {
		"确定": function () {
			$('#fenpei_form').submit();	
			$(this).dialog("close");
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});
$("#dialog-assign").dialog({
	autoOpen: false,
	modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100],
	buttons: {
		"确定": function () {
			var owner_role_id = $('input[name="owner_role_id"]').val();
			var message_alert = $('input:checkbox[name="message_alert"]:checked').val();
			var sms_alert = $('input:checkbox[name="sms_alert"]:checked').val();
			var email_alert = $('input:checkbox[name="email_alert"]:checked').val();

			$("#hidden_owner_id").val(owner_role_id);
			$("#hidden_message").val(message_alert);
			$("#hidden_sms").val(sms_alert);
			$("#hidden_email").val(email_alert);

			$("#form1").attr('action', '{:U("leads/batchassign")}');
			$("#form1").submit();
			$(this).dialog("close");
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});
$(function(){
	$(".excelExport").click(function(){
		if(count > limit_size){
			swal({   
				title: "当前导出量过大，将分几次导出，可能需要您等待一段时间，是否继续?",
				type: "warning",   
				showCancelButton: true,   
				confirmButtonColor: "#DD6B55",   
				confirmButtonText: "确定",   
				closeOnConfirm: false, 
				animation: "slide-from-top", 
				showLoaderOnConfirm: true
			}, 
			function(){
				remainTime();
			});
		}else{
			var id_array = new Array(); 
			$("input[class='check_list']:checked").each(function() {   
				id_array.push($(this).val());
			});
			if(id_array !=''){
				swal({   
					title: "{:L('CONFIRM_EXPORT_LEADS')}",
					type: "warning",
					showCancelButton: true,   
					confirmButtonText: "确定", 
					closeOnConfirm: false,
					animation: "slide-from-top",
					showLoaderOnConfirm: true
				}, 
				function(){
					remainTime();
				});
			}else{
				swal({
					title: "",
					text: "确定要导出数据吗？",
					type: "warning",
					showCancelButton: true,
					confirmButtonText: "确定",   
					closeOnConfirm: false, 
					animation: "slide-from-top", 
					showLoaderOnConfirm: true
				},
				function(){
					remainTime();
				});
			}
		}
	});

	$('#delete').click(function(){
		var id_array = new Array();
		$("input.check_list:checked").each(function(){  
			id_array.push($(this).val());
		});
		if(id_array.length == 0){
			alert_crm('{:L('PLEASE_CHOOSE_THE_LEADS')}');
			return false;
		}
		swal({
			title: "您确定要删除线索信息吗？",
			text: "删除后将无法恢复，请谨慎操作！",
			type: "warning",   
			showCancelButton: true,   
			confirmButtonColor: "#DD6B55",   
			confirmButtonText: "是的，我要删除！",
	        cancelButtonText:'让我再考虑一下…',
	        closeOnConfirm:false,
	        closeOnCancel:false
		},
		function(isConfirm){
	        if (isConfirm) {
	        	$.ajax({
		            type:'post',
		            url: "{:U('leads/delete')}",
		            data: {leads_id: id_array},
		            async: false,
		            success: function (data) {
						if (data.status == 1) {
							swal("删除成功！", "您已经永久删除了信息！", "success");
							history.go(0);
						} else {
							swal({
								title: "操作失败！",
								text:data.info,
								type: "error"
							})
							return false;
						}
		            },
		            dataType: 'json'
		        });
	        } else {
	            swal("已取消","您取消了删除操作！","error");
	        }
	    });
	});

	//放入线索池
	$('#remove').click(function(){
		swal({   
			title: "{:L('CONFIRM_PUT_LEADS_INTO_THE_POOL')}",
			type: "warning",   
			showCancelButton: true,   
			confirmButtonColor: "#DD6B55",   
			confirmButtonText: "确定",   
			closeOnConfirm: false 
		}, 
		function(){  
			$("#form1").attr('action', '{:U("leads/remove")}');
			$("#form1").submit(); 
		});
	});

	//批量领取
	$('#batch_receive').click(function(){
		swal({   
			title: "{:L('CONFIRM_BATCH_RECEIVE_LEADS')}",
			type: "warning",   
			showCancelButton: true,   
			confirmButtonColor: "#DD6B55",   
			confirmButtonText: "确定",   
			closeOnConfirm: false 
		}, 
		function(){  
			$("#form1").attr('action', '{:U("leads/batchReceive")}');
			$("#form1").submit(); 
		});
	});

	$('#batch_assign').click(function(){
		$('#dialog-assign').dialog('open');
		$('#dialog-assign').load('{:U("leads/assigndialog")}');
	});

	//线索转换
	$('#transform').click(function(){
		$("#form1").attr('action', '{:U("leads/transform")}');
		$("#form1").submit();
	});	
	$("#import_excel").click(function(){
		$('#dialog-import').dialog('open');
		$('#dialog-import').load('{:U("leads/excelimport")}');
	});
	$(".role_info").click(function(){
		$role_id = $(this).attr('rel');
		$('#dialog-role-info').dialog('open');
		$('#dialog-role-info').load('{:U("user/dialoginfo","id=")}'+$role_id);
	});
	$(".fenpei").click(function(){
		$id = $(this).attr('rel');
		$('#dialog-fenpei').dialog('open');
		$('#dialog-fenpei').load('{:U("leads/fenpei","id=")}'+$id);
	});
	$("#check_send").click(function(){
		var id_array = new Array();
		$("input[class='check_list']:checked").each(function(){  
			id_array.push($(this).val());
		});
		if(id_array.length == 0){
			alert("{:L('PLEASE_CHOOSE_THE_LEADS')}");
		}else{
			var leads_ids = id_array.join(",");
			window.open("{:U('setting/sendSms', 'model=leads&leads_ids=')}"+leads_ids);
		}
	});
	$("#check_send_email").click(function(){
		var id_array = new Array();
		$("input[class='check_list']:checked").each(function(){  
			id_array.push($(this).val());
		});
		if(id_array.length == 0){
			alert("{:L('PLEASE_CHOOSE_THE_LEADS')}");
		}else{
			var leads_ids = id_array.join(",");
			window.open("{:U('setting/sendemail', 'model=leads&leads_ids=')}"+leads_ids);
		}
	});

	$("#page_send").click(function(){
		var id_array = new Array();
		$("input[class='check_list']").each(function(){
			id_array.push($(this).val());
		});
		if(id_array.length == 0){
			alert("{:L('PLEASE_CHOOSE_THE_LEADS')}");
		}else{
			var leads_ids = id_array.join(",");
			window.open("{:U('setting/sendSms', 'model=leads&leads_ids=')}"+leads_ids);
		}
	});
	$("#page_send_email").click(function(){
		var id_array = new Array();
		$("input[class='check_list']").each(function(){
			id_array.push($(this).val());
		});
		if(id_array.length == 0){
			alert("{:L('PLEASE_CHOOSE_THE_LEADS')}");
		}else{
			var leads_ids = id_array.join(",");
			window.open("{:U('setting/sendemail', 'model=leads&leads_ids=')}"+leads_ids);
		}
	});

	$("#all_send").click(function(){
		$("#act").val('sms');
		$("#searchForm").submit();
	});
	$("#all_send_email").click(function(){
		window.open("{:U('setting/sendemail', 'model=leads&leads_ids=all')}");
	});

	$("#dosearch").click(function(){
		result = checkSearchForm();
		if(result) $("#act").val('search');$("#searchForm").submit();
	});
});
</script>

<!-- loading加载 -->
<style type="text/css">
	#box{
		position:absolute;
		top:0;
		bottom:0;
		left:0;
		right:0;
		background:#000;
		opacity:0.7;
		
		padding-top: 200px;
		padding-left: 45%;
	}
</style>
<!-- <div id="box" style="display: none;"><img src="__PUBLIC__/img/loading.gif" width="80px"></div>
<script type="text/javascript">
	//呼叫功能
	$('.call').click(function(){
		$('#box').show();

		var phone = $(this).attr('phone');
		var extid = "{$_SESSION['extid']}";
		var agent_ip = "{:C('AGENT_IP')}";
		
		if (!phone) {
			alert_crm('没有联系方式！');
			$('#box').hide();
			return false;
		}
			
		$.ajax({
			type:'get',
			url: "http://"+agent_ip+"/agent/index.php/home/index/call",
			data: {phone:phone, extid:extid},
			async:true,
			success:function(data){
				if (data.status == 1) {
					$('#box').hide();
				} else {
					$('#box').hide();
					alert_crm(data.info);
				}
			},
			error:function(){
				$('#box').hide();
				alert_crm('响应失败，请联系管理员检查呼叫配置！');
			},
			dataType:'json'
		});
	});
</script> -->

<include file="Public:footer" />